package com.hotelsystem.dao;

import com.hotelsystem.pojo.Logging;
import com.hotelsystem.pojo.vo.LoggingQueryVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface LoggingMapper {

    /**
     * 添加日志信息
     * @param logging
     * @return
     * @throws Exception
     */
    @Insert("insert into t_logging values(null,#{message},#{createDate},#{operator})")
    Integer insert(Logging logging) throws Exception;

    /**
     * 获得所有的日志信息
     * @param loggingQueryVo
     * @return
     */
    List<Logging> getAllLoggingLists(@Param("loggingQueryVo") LoggingQueryVo loggingQueryVo);

    /**
     * 删除日志信息
     * @param loggingId 日志编号
     * @return
     */
    @Delete("DELETE from t_logging where t_logging.logging_id=#{loggingId}")
    Integer deleteLoggingInfoById(Integer loggingId);
}
